namespace SupplierCustomerManagement.Domain.Enums
{
    /// <summary>
    /// 枚举辅助类
    /// 提供枚举相关的静态辅助方法
    /// </summary>
    public static class EnumHelper
    {
        /// <summary>
        /// 获取账户关系类型的所有选项
        /// </summary>
        /// <returns>账户关系类型字典，键为枚举值，值为显示名称</returns>
        public static Dictionary<AccountRelationshipType, string> GetAccountRelationshipTypes()
        {
            return EnumExtensions.GetEnumDescriptions<AccountRelationshipType>();
        }

        /// <summary>
        /// 获取账户类型的所有选项
        /// </summary>
        /// <returns>账户类型字典，键为枚举值，值为显示名称</returns>
        public static Dictionary<AccountType, string> GetAccountTypes()
        {
            return EnumExtensions.GetEnumDescriptions<AccountType>();
        }

        /// <summary>
        /// 获取账户属性的所有选项
        /// </summary>
        /// <returns>账户属性字典，键为枚举值，值为显示名称</returns>
        public static Dictionary<AccountProperty, string> GetAccountProperties()
        {
            return EnumExtensions.GetEnumDescriptions<AccountProperty>();
        }

        /// <summary>
        /// 获取实体类型的所有选项
        /// </summary>
        /// <returns>实体类型字典，键为枚举值，值为显示名称</returns>
        public static Dictionary<EntityType, string> GetEntityTypes()
        {
            return EnumExtensions.GetEnumDescriptions<EntityType>();
        }

        /// <summary>
        /// 根据描述获取账户关系类型
        /// </summary>
        /// <param name="description">描述信息</param>
        /// <returns>对应的账户关系类型，如果找不到则返回null</returns>
        public static AccountRelationshipType? GetAccountRelationshipTypeByDescription(string description)
        {
            return EnumExtensions.GetEnumByDescription<AccountRelationshipType>(description);
        }

        /// <summary>
        /// 根据描述获取账户类型
        /// </summary>
        /// <param name="description">描述信息</param>
        /// <returns>对应的账户类型，如果找不到则返回null</returns>
        public static AccountType? GetAccountTypeByDescription(string description)
        {
            return EnumExtensions.GetEnumByDescription<AccountType>(description);
        }

        /// <summary>
        /// 根据描述获取账户属性
        /// </summary>
        /// <param name="description">描述信息</param>
        /// <returns>对应的账户属性，如果找不到则返回null</returns>
        public static AccountProperty? GetAccountPropertyByDescription(string description)
        {
            return EnumExtensions.GetEnumByDescription<AccountProperty>(description);
        }

        /// <summary>
        /// 根据描述获取实体类型
        /// </summary>
        /// <param name="description">描述信息</param>
        /// <returns>对应的实体类型，如果找不到则返回null</returns>
        public static EntityType? GetEntityTypeByDescription(string description)
        {
            return EnumExtensions.GetEnumByDescription<EntityType>(description);
        }
    }
}